/// FIGURE 2

	use "$dir/results/sounds_estimates",clear
	append using "$dir/results/nonsense_estimates", gen(nonsense)
	append using "$dir/results/reading_estimates", gen(reading)
	append using "$dir/results/readcomp_estimates", gen(readcomp)
	append using "$dir/results/allliter_estimates", gen(allliter)
	gen var=""
	replace var="sounds" if nonsense==0
	replace var="nonsense" if nonsense==1
	replace var="reading" if reading==1
	replace var="readcomp" if readcomp==1
	replace var="allliter" if allliter==1
	drop nonsense reading readcom allliter
	

	//Sort
	 gen order=1 if var=="sounds"
	 replace order=2 if var=="nonsense"
	 replace order=3 if var=="reading"
	 replace order=4 if var=="readcomp"
	 replace order=5 if var=="allliter"
     gsort  spec_id order
	
	//Rank 
	by spec_id:  gen rank=_n
	replace rank=rank +0.1 if spec_id==2
	replace rank=rank +0.2 if spec_id==3
	replace rank=rank +0.3 if spec_id==4
	replace rank=rank +0.4 if spec_id==5
	
	//Gen indicators and scatters

	//Gen indicators and scatters
	tw  (rcap u95 l95 rank if spec_id==1, lcolor(gs1)) ///
		(rcap u95 l95 rank if spec_id==2, lcolor(gs4)) ///	
		(rcap u95 l95 rank if spec_id==3, lcolor(gs7)) ///
		(rcap u95 l95 rank if spec_id==4, lcolor(gs10)) ///	
		(rcap u95 l95 rank if spec_id==5, lcolor(gs14)) ///	
		(rspike u95 l95 rank if spec_id==1, lcolor(gs1)) ///
		(rspike u95 l95 rank if spec_id==2, lcolor(gs4)) ///	
		(rspike u95 l95 rank if spec_id==3, lcolor(gs7)) ///
		(rspike u95 l95 rank if spec_id==4, lcolor(gs10)) ///	
		(rspike u95 l95 rank if spec_id==5, lcolor(gs14) ) ///		
		(scatter beta rank if spec_id==1, msymbol(X) mcolor(gs1) msize(medium)) ///
		(scatter beta rank if spec_id==2, msymbol(circle) mcolor(gs4) msize(small)) ///
		(scatter beta rank if spec_id==3, msymbol(square) mcolor(gs7) msize(small)) ///
		(scatter beta rank if spec_id==4, msymbol(T) mcolor(gs10) msize(small)) ///
		(scatter beta rank if spec_id==5, msymbol(diamond) mcolor(gs14) msize(small)), ///
		legend(order(11 "Main Spec." 12 "Strata x Date FE."  13 "KG. controls" 14 "Lee lower-bound" 15 "Second round" ) ///
		region(lcolor(white)) pos(6) ring(1) rows(2) size(vsmall) symysize(small) symxsize(small)) ///
		graphregion(fcolor(white) lcolor(white)) plotregion(fcolor(white) lcolor(white)) ///
		xtitle(" ") ytitle(" ") yscale(noline) xscale(noline) ///
		ylab(0(0.2)0.8, format(%9.2fc) noticks nogrid angle(horizontal) labsize(small)) ///
		yline(0, lp(shortdash) lcolor(red) lw(thin)) xlab("", noticks)  
		
	   
	global legend custom tickset(major) editstyle(tickstyle(textstyle(size(vsmall))))
		gr_edit .xaxis1.add_ticks +1.3 `"Sounds"', $legend
		gr_edit .xaxis1.add_ticks +2.3 `"Non-words  "', $legend
		gr_edit .xaxis1.add_ticks +3.3  `"Reading fluency"', $legend
		gr_edit .xaxis1.add_ticks +4.3 `"Reading Comprehension"', $legend
		gr_edit .xaxis1.add_ticks +5.3 `"Literacy score"', $legend

		gr export "$dir/results/figrob_all_ByOut.png", replace  //wid(700) hei(500) 	
		
		
//erase
foreach var in sounds nonsense reading readcomp allliter{
	erase "$dir/results/`var'_estimates.dta"
	
}


